/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sk.ke.szatmary.peter.jclac.simpleCiphers.examples;

import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import sk.ke.szatmary.peter.jclac.simpleCiphers.Caesar;
import sk.ke.szatmary.peter.jclac.simpleCiphers.SimpleCipherAttr;
import sk.ke.szatmary.peter.jclac.simpleCiphers.core.SimpleCipher;
import sk.ke.szatmary.peter.jclac.simpleCiphers.core.SimpleCipherException;

/**
 *
 * @author nue
 */
public class CaesarExampleAppA {

    public static void main(String[] args) {

        List<SimpleCipherAttr> listAttr;
        listAttr = new ArrayList<SimpleCipherAttr>();
        listAttr.add(new SimpleCipherAttr(4));
        try {
            String plain = "plain text 4";
            SimpleCipher caesar = new Caesar(listAttr);
            String encrypted = caesar.getEncrypted(plain);
            String decrypted = caesar.getDecrypted(encrypted);

            System.out.println("PLAIN STRING: " + plain);
            System.out.println("ENCRYPTED STRING: " + encrypted);
            System.out.println("DECRYPTED STRING: " + decrypted);

            List<SimpleCipherAttr> list = caesar.getAttributes();
            System.out.println("INPUT ATTRIBUTE: " + list.get(0).getValue());
            System.out.println("TRANSFORMED ATTRIBUTE: " + list.get(0).getChangedValue());

        } catch (SimpleCipherException ex) {
            Logger.getLogger(CaesarExampleAppA.class.getName()).log(Level.SEVERE, null, ex);

        }
    }
}
